import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'
import Shouye from '../components/Shouye.vue'
import Gallery from '../components/Gallery.vue'


import DrugIndex from '../components/drug/DrugIndex.vue'
import DrugList from '../components/drug/DrugList.vue'
import DrugDistribution from '../components/drug/DrugDistribution.vue'
import Withdrawal from '../components/drug/Withdrawal.vue'


import AssetManage from '../components/assetmanagement/AssetManage.vue'
import WardManage from '../components/assetmanagement/WardManage.vue'
import DeviceManage from '../components/assetmanagement/DeviceManage.vue'
import CheckProjectManage from '../components/assetmanagement/CheckProjectManage.vue'
import SurgeryManage from '../components/assetmanagement/SurgeryManage.vue'


import PatientSurgeryList from '../components/patientsurgerylist/PatientSurgeryList.vue'
import EntryAndExitIndex from '../components/entryandexitmanagement/EntryAndExitIndex.vue'
import AdmissionList from '../components/entryandexitmanagement/AdmissionList.vue'
import DischargeList from '../components/entryandexitmanagement/DischargeList.vue'


import PatientCheckIndex from '../components/patientchecklist/PatientCheckIndex'
import PatientSurgeryIndex from '../components/patientsurgerylist/PatientSurgeryIndex.vue'
import Case from "../components/outpatient/Case.vue"
import PatientCheckList from '../components/patientchecklist/PatientCheckList.vue'
import Registered from "../components/outpatient/Registered.vue"
import OutPatientIndex from "../components/outpatient/OutPatientIndex.vue"

import InPatientIndex from "../components/inpatient/InPatientIndex.vue"
import InPatient from "../components/inpatient/InPatient.vue"
import InPatientAdmission from "../components/inpatient/InPatientAdmission.vue"

import NurseIndex from '../components/nurse/NurseIndex.vue'
import NursePatient from '../components/nurse/NursePatient.vue'
import RegisterList from '../components/registered/RegisterList.vue'
import RegisterManageIndex from '../components/registered/RegisterManageIndex.vue'
import Scheduling from '../components/scheduling/Scheduling.vue'
import DrugMoneyIndex from '../components/drugMoney/DrugMoneyIndex.vue'
import DrugMoney from '../components/drugMoney/DrugMoney.vue'
import MoneyCountIndex from '../components/chargemanage/MoneyCountIndex.vue'
import MoneyCount from '../components/chargemanage/MoneyCount'
import Hospitalization from '../components/hospitalization/Hospitalization.vue'
import HospitalizationIndex from '../components/hospitalization/HospitalizationIndex.vue'
import OutHospitalMoneyIndex from '../components/OutHospitalMoney/OutHospitalMoneyIndex.vue'
import OutHospitalMoney from '../components/OutHospitalMoney/OutHospitalMoney'

import Employeemanage from '../components/Employeemanage/Employeemanage.vue'
import EmployeemanageIndex from '../components/Employeemanage/EmployeemanageIndex.vue'
import PermissionControl from '../components/permissionControl/PermissionControl.vue'
import CheckMoneyIndex from '../components/checkmoney/CheckMoneyIndex.vue'
import CheckMoney from '../components/checkmoney/CheckMoney.vue'


import RateLimit from "../components/handle/RateLimit.vue";
import Chat from "../components/Chat.vue"

import hospitalManage  from "../components/handle/HospitalManage.vue";


import echarts from 'echarts'







//需要挂载到Vue原型上
Vue.prototype.$echarts = echarts



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Login
  },
  {
    path: '/Home', component: Home,
    children: [
      {
        path: '/drugIndex', component: DrugIndex,

        children: [

          { path: '/drugList', component: DrugList },
          { path: '/drugDistribution', component: DrugDistribution },
          { path: '/withdrawal', component: Withdrawal },
          { path: '/Gallery', component: Gallery}
        ]

      },
      {
        path: '/assetManage', component: AssetManage,
        children: [

          { path: '/wardManage', component: WardManage },
          { path: '/deviceManage', component: DeviceManage },
          { path: '/checkProjectManage', component: CheckProjectManage },
          { path: '/surgeryManage', component: SurgeryManage }
        ]
      },
      {
        path: '/outPatientIndex', component: OutPatientIndex,
        children: [
          { path: "/", redirect: '/registered' },
          { path: '/registered', component: Registered },
          { path: '/case', component: Case }
        ]
      },
      {
        path: "/patientcheckindex", component: PatientCheckIndex,
        children: [
          { path: "/", redirect: "/patientchecklist" },
          { path: "/patientchecklist", component: PatientCheckList }
        ]
      },
      {
        path: "/patientsurgeryindex", component: PatientSurgeryIndex,
        children: [
          { path: "/", redirect: "/patientsurgerylist" },
          { path: "/patientsurgerylist", component: PatientSurgeryList }

        ]
      },
      {
        path: "/entryandexitindex", component: EntryAndExitIndex,
        children: [
          { path: "/admissionlist", component: AdmissionList },
          { path: "/dischargelist", component: DischargeList }
        ]
      },
      {
        path: "/nurseindex", component: NurseIndex,
        children: [
          { path: "/nursepatient", component: NursePatient }
        ]
      },
      {
        path: "/inPatientIndex", component: InPatientIndex,
        children: [
          { path: "/", redirect: '/inPatient' },
          { path: '/inPatient', component: InPatient },
          { path: '/inPatientAdmission', component: InPatientAdmission },
        ]
      },
      {
        path: "/registermanageindex", component: RegisterManageIndex,
        children: [
          { path: "/registerlist", component: RegisterList },
          {path: "/schedulinglist", component: Scheduling}
        ]
      },

      {
        path: "/shouye", component: Shouye
      },
      { path: "/", redirect: '/shouye'},//index页面重定向

      {
        path:"/hospitalManage",component:hospitalManage
      },

      { path:'/chat', component:Chat},
      {
        path: '/employmanageIndex', component: EmployeemanageIndex,

        children: [
          { path: '/', redirect: '/employeemanage' },
          { path: '/employeemanage', component: Employeemanage },
        ]

      },
      {
        path: '/employmanageIndex', component: EmployeemanageIndex,

        children: [
          { path: '/', redirect: '/permissionControl' },
          { path: '/permissionControl', component: PermissionControl },
        ]

      },
      {
        path: '/checkMoneyIndex', component: CheckMoneyIndex,

        children: [
          { path: '/', redirect: '/checkMoney' },
          { path: '/checkMoney', component: CheckMoney },
        ]

      },
      {
        path: '/drugMoneyIndex', component: DrugMoneyIndex,

        children: [
          { path: '/', redirect: '/drugMoney' },
          { path: '/drugMoney', component: DrugMoney },
        ]

      },
      {
        path: '/moneyCountIndex', component: MoneyCountIndex,

        children: [
          { path: '/', redirect: '/moneyCount' },
          { path: '/moneyCount', component: MoneyCount },
        ]

      },
      {
        path: '/hospitalizationIndex', component: HospitalizationIndex,

        children: [
          { path: '/', redirect: '/hospitalization' },
          { path: '/hospitalization', component: Hospitalization },
        ]

      },
      {
        path: '/outHospitalMoneyIndex', component: OutHospitalMoneyIndex,

        children: [
          { path: '/', redirect: '/outHospitalMoney' },
          { path: '/outHospitalMoney', component: OutHospitalMoney },
        ]

      },


    ]
  },
  {
    path:'/rateLimit',component:RateLimit
  }
]

const router = new VueRouter({
  routes
})

export default router
